<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<#include "../../common/res.html">
		
		<script type="text/javascript">
			var id_sbj = "${id_sbj}";
			function doDelete(rowNum){
				if(confirm("确定删除?")){
					window.location.href='${s.base}/data/delete.html?id_sbj='+id_sbj+'&rowNum='+rowNum ;
				}
			}
		</script>
	</head>
	
	<body class="bg">
		<#include "../../common/top.html">
		
		<div class="content">
			<div class="block-nav">
				<#include "../../common/nav.html">
			</div>
			
			<div class="block-content" >
			
				<div class="block-content-nav">
					<span class="title">专题管理 </span>
				</div>
				
				<div class="block-content-description">
					<span>
						数据管理
					</span>
				</div>
				<form id="queryPageForm" action="${s.base}/data/dataManager.html?id_sbj=${id_sbj}">
				<div class="block-content-content">
					<table class="fm-table">
						<thead>
							<tr >
								<#if (itemList?size>0) >
								<#list itemList as itemRow>
								<td>${itemRow.name!}</td>
								</#list>
								<td>
									<input class="btn" onclick="window.location.href='${s.base}/data/toMerge.html?id_sbj=${id_sbj}'" type="button" value="添 加"/>
								</td>
								<#else>
								<td style="color:red">
									请先添加数据项后再添加数据
								</td>
								</#if>
							</tr>
						</thead>
						<tbody>
							<input id="id_sbj" name="id_sbj" type="hidden" value="${RequestParameters['id_sbj']!}"/>
							<#if pagination.items??>
							<#list pagination.items as dataRowMap>
								<tr id = "${dataRowMap_index!}">
									<#list itemList as item>
										<#if item.type=="blob" >
										<td> BLOB......</td>
										<#else>
											<#if (dataRowMap[item.name])!?length gt 10>
										<td> ${(dataRowMap[item.name]?substring(0,10))!}......</td>
											<#else>
										<td> ${(dataRowMap[item.name])!}</td>
											</#if>
										</#if>
									</#list>
									<td>
										<a href="javascript:void(0);" onclick="doDelete(${dataRowMap['rowNum']!})">删除</a>&nbsp;&nbsp;
										<a href="${s.base}/data/toMerge.html?id_sbj=${id_sbj}&rowNum=${dataRowMap['rowNum']!}" >修改</a>
									</td>
								</tr>
							</#list>
							</#if>
						</tbody>
					</table>
					<#include "../../common/pagination.html">
				</div>
				</form>
			</div>
			<div class="clearfloat"></div>
		</div>
		
		<#include "../../common/footer.html">
	</body>
	
</html>
